<?php
// +----------------------------------------------------------------------
// | ThinkBLOG
// +----------------------------------------------------------------------
// | @link ( http://www.yurnero.net )
// +----------------------------------------------------------------------
// | @licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | @author nicholas <nicholasinlove@126.com>
// +----------------------------------------------------------------------
// | $Id: IndexAction.class.php 42 2011-09-29 15:56:08Z nicholasinlove1986@gmail.com $
// +----------------------------------------------------------------------


import('RelationModel');
class PostsModel extends RelationModel {

	protected $_link=array(
		'Relationships'=>array(
			'mapping_type'=>HAS_MANY,
			'class_name'=>'Relationships',
			'foreign_key'=>'postid',
			'mapping_name'=>'count',
			'mapping_fields'=>'count(postid) as count', 
			'condition'=>'metaid = 1',
		 ),
	);
}

?>